Skip to content

fix: handle chunked transfer encoding and drain Runtime API responses#3

Open
skunxicat wants to merge 1 commit into
mainfrom
next
Open

fix: handle chunked transfer encoding and drain Runtime API responses#3
skunxicat wants to merge 1 commit into
mainfrom
next

Conversation

@skunxicat

Copy link
Copy Markdown
Contributor

The Lambda Runtime API does not always send Content-Length headers, using Transfer-Encoding: chunked instead. This caused the bootstrap to read 0 bytes, passing empty events to handlers.

Additionally, sendResponse/sendError did not read the Runtime API acknowledgment, causing InvalidStateTransition errors on subsequent invocations.

Changes:

  • Case-insensitive header parsing in getNextInvocation
  • Chunked transfer encoding support
  • Connection: close on all requests
  • Read status line after sendResponse/sendError

The Lambda Runtime API does not always send Content-Length headers,
using Transfer-Encoding: chunked instead. This caused the bootstrap
to read 0 bytes, passing empty events to handlers.

Additionally, sendResponse/sendError did not read the Runtime API
acknowledgment, causing InvalidStateTransition errors on subsequent
invocations.

Changes:
- Case-insensitive header parsing in getNextInvocation
- Chunked transfer encoding support
- Connection: close on all requests
- Read status line after sendResponse/sendError
@skunxicat skunxicat marked this pull request as ready for review June 22, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant